/* eslint valid-jsdoc: "off" */

"use strict";

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = (appInfo) => {
    /**
     * built-in config
     * @type {Egg.EggAppConfig}
     **/
    const config = (exports = {});
    config.sequelize = {
        dialect: "mysql",
        host: "127.0.0.1",
        port: 3306,
        user: "root",
        password: "123456",
        database: "egg_house",
        define: {
            timestamps: false,
            freezeTableName: true,
        },
    };
    config.jwt = {
        secret: "HL",
    };
    config.security = {
        csrf: {
            enable: false,
        },
    };
    config.session = {
        key: "MUKE_SESS",
        httpOnly: true,
        maxAge: 1000 * 50,
        renew: true,
    };
    config.auth = {
        exclude: ["/api/user/login", "/api/user/register"],
    };

    // use for cookie sign key, should change to your own and keep security
    config.keys = appInfo.name + "_1608095298955_1772";

    // add your middleware config here
    config.middleware = [];

    config.redis = {
        client: {
            port: 6379,
            host: "127.0.0.1",
            password: "123456",
            db: 0,
        },
    };

    // add your user config here
    const userConfig = {
        salt: "HL",
        redisExpire: 60 * 60 * 24,
    };

    return {
        ...config,
        ...userConfig,
    };
};
